﻿using System.Collections.Generic;
using Kugar.ERPFramework.Core;
using Kugar.ERPFramework.Core.Entity;

namespace Kugar.ERPFramework.BLLInterface
{
    public interface IProject
    {

        /// <summary>
        ///     返回当前工程的所有项目实例信息列表
        /// </summary>
        /// <returns></returns>
        
        ProjectInstanceInfo[] GetInstanceList();

        /// <summary>
        ///     根据ID返回项目实例
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        
        //IProjectInstance GetInstanceByID(string key);

        /// <summary>
        ///     当前项目中,所有实例的数量
        /// </summary>
        
        int GetInstanceCount();

        /// <summary>
        ///     新建实例
        /// </summary>
        /// <param name="name">新建实例的名称</param>
        /// <param name="config">实例配置信息</param>
        ProjectInstanceInfo NewIntance(string name, Dictionary<string, string> config);

        /// <summary>
        ///     关闭实例,并删除掉该实例的链接
        /// </summary>
        /// <param name="name">关闭实例的名称</param>
        
        void CloseInstance(string name);

        /// <summary>
        ///     停止一个实例的服务
        /// </summary>
        /// <param name="name"></param>
        
        void StopInstance(string name);

        /// <summary>
        ///     启动一个实例的服务
        /// </summary>
        /// <param name="name"></param>
        
        void StartInstance(string name);

        ProjectInfo Info {get; }

        DBConnectionConfig[] GetConnectionByInstanceID(string instanceID);
    }
}